package com.example.weddingapp.adapter;

import com.example.weddingapp.R;
import com.example.weddingapp.base.binding.BaseBindingAdapter;
import com.example.weddingapp.base.binding.BaseBindingHolder;
import com.example.weddingapp.databinding.ItemActivityBinding;
import com.example.weddingapp.utils.ImageLoaderUtil;

import cn.leancloud.AVFile;
import cn.leancloud.AVObject;


/**
 * @author DaQiang
 * @Date 2020/5/11 20:31
 * @Desc 活动
 */
public class ActivityAdapter extends BaseBindingAdapter<AVObject, ItemActivityBinding> {

    public ActivityAdapter() {
        super(R.layout.item_activity);
    }

    @Override
    protected void bindView(BaseBindingHolder holder, AVObject bean, ItemActivityBinding binding, int position) {

        AVFile headImg = bean.getAVFile("image");
        if (headImg != null)
            ImageLoaderUtil.displayNet(holder.itemView.getContext(), headImg.getUrl(), binding.ivActivity);

    }
}
